Label
The most basic Label control is intended to display text in your report. It can represent static or dynamic text, or both. In addition, it can be used to calculate standard summary functions across a data field. The label's text can only be formatted as a whole. So, if it's required to differently format parts of text, use the Rich Text control.
After a label is added to a report, you can customize its text, appearance and other properties, which can be accessed in the Property Grid. The most important properties are also available via a control's Smart Tag, which makes it easy to perform common operations.
In the Property Grid, the label control's properties are divided into the following groups.
Property | Description |
---|---|
Background Color | Specifies the background color for the control. This option is also available on the ribbon. |
Borders, Border Color, Border Dash Style and Border Width | Specify border settings for the control. |
Font | Specifies the font settings for the control. Some of these settings are available in the Font section on the ribbon. |
Foreground Color | Specifies the text color for the control. |
Formatting Rules | Opens the Formatting Rules Editor, allowing you to choose which rules should be applied to the control during report generation, and define the precedence of the applied rules. To learn more on this, see Conditionally change a control's appearance. |
Padding | Specifies indent values which are used to render the contents of a label. |
Style Priority | Specifies the priority of various style elements (such as background color, border color, etc.). For more information on style inheritance, see Understand styles concepts. |
Styles | Specifies odd and even styles for the control, as well as to assign an existing style to the control (or a newly created one). For more information on style inheritance, see Understand styles concepts. |
Text Alignment | Specifies the alignment of the control's text. This option is also available in the Font section on the ribbon. |
Text Trimming | Allows you to set the trimming behavior employed when text overflows the check box area. |
Property | Description |
---|---|
Anchor Horizontally |
Specifies the horizontal anchoring style of a label, so that after page rendering it stays attached to the left control, right control, or both. Note that if the Anchor Horizontally property is set, the Can Grow and Can Shrink property (see below) values are ignored, and don't participate in calculating a final width value of this control. |
Anchor Vertically |
Specifies the vertical anchoring style of a label, so that after page rendering it stays attached to the top control, bottom control, or both. The property setting is useful for data-bound labels located between upper and lower controls, which are allowed to resize depending on their contents. Note that if the Anchor Vertically property is set to Bottom or Both, the Can Grow and Can Shrink property (see below) values are ignored, and don't participate in calculating a final height value of this control. |
Angle | Specifies the rotation angle of the text. The measurement unit is a degree, and the orientation is counter-clockwise. Since standard HTML does not support text orientation, this parameter is ignored when a report is displayed within a web page. |
Auto Width | Specifies whether or not a label's width should be automatically determined based on its text. |
Can Grow | When this property is set to Yes, a label's height can be automatically increased, if required, to display the text. If there are other controls below the current label, they will be pushed down to prevent them from overlapping. Note that if a control overlaps the growing label by even one pixel, it will not be pushed down by the growing label. |
Can Shrink | When this property is set to Yes, and the text does not completely fill a label, then the label's height will be decreased to the height of its text. If there are other controls below the current label, they will be moved up to fill the gap. Note that if a control overlaps the shrinking label by even one pixel, it will not be pushed up by the shrinking label. |
Keep Together | Specifies whether the contents of a label can be horizontally split across pages. In other words, if a label occupies more space than remains on the page, this property specifies whether this label should be split between the current page and the next, or whether it will be printed entirely on the next page. This property is in effect only when a label's content does not fit on the current page. If it does not fit on the next page either, then the label will be split, irrespective of this property's value. |
Multiline | When this property is set to Yes, a label processes newline characters found in the text to start a new line. For example, when editing a label's text, you can insert a new line by pressing ENTER, and in this case, the Multiline property will be automatically set to Yes. |
Process Duplicates Mode | Determines the control's behavior when its data source contains consecutive repeating records. They can be processed as is (when the property is set to Leave), suppressed except for the first entry (Suppress) and suppressed with the blank space printed instead of the repeated records (Suppress and Shrink). |
Process Duplicates Targets | Specifies whether to process duplicate values of the XRControl.Text, or XRControl.Tag property. |
Process Null Values | Determines whether to process Null (blank) values if they appear in the control's data source. They can be processed as is (when the property is set to Leave), suppressed (Suppress) and suppressed with the blank space printed instead of the blank records (Suppress and Shrink). |
Scripts | This property contains events, which you can handle with the required scripts. For more information on scripting, see Handle events via scripts. |
Visible | Specifies whether the control should be visible in Print Preview. |
Word Wrap | When this property is set to Yes, text entered into the multiline label is wrapped to the next line if it doesn't fit the line or comes across a newline character. If this property is set to No, text entered into the multiline label will be displayed on the same line until a newline character is entered. |
Property | Description |
---|---|
(Data Bindings) | This property allows you to bind some of the control's properties (Bookmark, NavigateURL, Tag and Text) to a data field obtained from the report's data source, and to apply a format string to it. |
Lines | Provides access to the Text property of a label in the Multiline mode. |
Null Value Text | Determines the text that is displayed if the label is bound to an empty data field. |
Summary |
Allows you to perform calculations (summary, max, min, average, etc.) over a data field. For more information on calculating summaries, see Add totals to a report. Note: Summarization is possible for a single data column only. To perform calculations with several data fields, use Add calculated fields. |
Tag |
This property allows you to add some additional information to the control; for example its id, by which it can then be accessible via scripts. The Tag property can be bound to a data field obtained from the data source. To do this, expand the (Data Bindings) property and in the Tag.Binding drop-down selector, select the required data field. |
Text |
Allows you to define a line of static text to be displayed. To type several lines of text, click on the control's Smart Tag, and in the actions list, click on Edit Text, or use the Lines property. Note that when a label is selected in the designer, you may simply start typing the text, and it will be automatically entered into the in-place editor.
The Text property can be bound to a data field obtained from the data source. To do this, expand the (Data Bindings) property and in the Text.Binding drop-down selector, select the required data field. |
Xlsx Format String | Specifies the native XLSX format string for the control's content, which is to be preserved when the report is being exported to XLSX. This format string is independent from the general value formatting. |
Property | Description |
---|---|
(Name) | Determines a control's name, by which it can be accessed in the Report Explorer, Property Grid or via scripts. |
Property | Description |
---|---|
Location | Specifies the control's location, in report measurement units. |
Size | Specifies the control's size, in report measurement units. |
Snap Line Margin | Specifies the margin (in report measurement units), which is to be preserved around the control when it is aligned using Snap Lines, or when other controls are aligned next to it. |
Property | Description |
---|---|
Bookmark and Bookmark Parent |
These properties are intended for the creation of a hierarchical structure within a report called a document map. For an explanation and help, see Add bookmarks. The Bookmark property can be bound to a data field, obtained from the data source. To do this, expand the (Data Bindings) property, and in the Bookmark.Binding drop-down selector, select the required data field. |
Navigate URL and Target |
Use the Navigate URL property to specify a URL for web browser navigation, when a user clicks on a label. The web browser displays a page in a window or a frame as specified by the Target property. Note that a URL should have an appropriate prefix (e.g. "http://"). You can create cross-references within the report by assigning the name of the target control to the Navigate URL property, and setting the Target property to "_self". For more information, see Create hyperlinks. The Navigate URL property can be bound to a data field obtained from the data source. To do this, expand the (Data Bindings) property, and in the Navigate URL.Binding drop-down selector, select the required data field. |